import { createApp } from 'vue'
import App from './App'
import router from './router'
import store from './store'
import globalFilter from '@/utils/globalFilter'
import 'ant-design-vue/dist/antd.less'
import Antd from 'ant-design-vue'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

// 测试环境默认使用mock
if (process.env.NODE_ENV === 'development') {
  const { mockXHR } = require('@/utils/static')
  mockXHR()
}

// 进度条配置
NProgress.configure({
  easing: 'ease', // CSS缓动字符串
  speed: 500, // 递增进度条的速度
  showSpinner: false, // 是否显示加载ico
  trickleSpeed: 200, // 自动递增间隔毫秒
  minimum: 0.1, // 初始化时的最小百分比
})

var app = createApp(App)

//注册全局属性（2.0过滤器的迁移到3.0的方案）
globalFilter(app)

//引入ant-design-vue UI框架
app.use(Antd)

app.use(store).use(router).mount('#app')
